package edu.uow.devdocs
/**
 * The DowntimeReport entity.
 *
 * @author    
 *
 *
 */
class DowntimeReport {
    static mapping = {
         table 'DOWNTIME_REPORT'
         // version is set to false, because this isn't available by default for legacy databases
         version false
         id column:'DOWNTIME_REPORT_ID'
		 id generator: 'sequence', params:[sequence:'DOWNTIME_REPORT_SEQ']
         project column:'SUB_SYSTEM_ID'
         status column:'STATUS_ID'
         person column:'PERSON_ID'
		 sort dateOfOccurance:'ASC'
    }
    Date dateOfOccurance
    Date dateOfResolution
    String description
    java.math.BigDecimal minutesDown
    String report
    String referenceNumber
    Date lastUpdated
    // Relation
    Project project
    // Relation
    DowntimeReportStatus status
    // Relation
    Person person

    static constraints = {
        dateOfOccurance(nullable: true)
        dateOfResolution(nullable: true)
        description(size: 0..255)
        minutesDown(nullable: true, size: 0..22)
        report(nullable: true)
        referenceNumber(size: 0..20)
        lastUpdated(nullable: true)
        project()
        status()
        person()
    }
    String toString() {
        return "${description}" 
    }
}
